﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="true">
  <class name="VTMS.Model.Entities.Depute,VTMS.Model.Entities" table="depute" lazy="false">

    <!-- Primary Key(s) -->
    <id name="Serial" column="serial" type="String">
      <generator class="assigned"/>
    </id>

    <!-- Properties -->
    <property column="reserial" type="String" name="Reserial"/>
    <many-to-one column="originid" class="VTMS.Model.Entities.Customer,VTMS.Model.Entities" name="OriginCustomer" cascade="save-update" unique="true"/>
    <property column="originpic" type="Byte[](2048576)" name="Originpic" />
    <many-to-one column="currentid" class="VTMS.Model.Entities.Customer,VTMS.Model.Entities" name="CurrentCustomer" cascade="save-update" unique="true"/>
    <property column="currentpic" type="Byte[](2048576)" name="Currentpic" />
    <property column="license" type="String" name="License" not-null="true" length="5" />
    <property column="vin" type="String" name="Vin" not-null="true" length="20" />
    <many-to-one column="vehicletype" class="VTMS.Model.Entities.Vehicletype,VTMS.Model.Entities" name="Vehicletype" cascade="none" unique="true" />
    <property column="brand" type="String" name="Brand" length="50" />
    <property column="certificate" type="String" name="Certificate" length="20" />
    <property column="register" type="String" name="Register" not-null="true" length="6" />
    <property column="certification" type="String" name="Certification" not-null="true" length="8" />
    <property column="department" type="String" name="Department" not-null="true" length="50" />
    <many-to-one column="company" class="VTMS.Model.Entities.Company,VTMS.Model.Entities" name="Company" cascade="none" unique="true" />
    <many-to-one column="saver" class="VTMS.Model.Entities.Users,VTMS.Model.Entities" name="Saver" cascade="none" />
    <property column="save_date" type="DateTime" name="SaveDate" not-null="true" />
    <property column="firstpic" type="Byte[](2048576)" name="Firstpic" />
    <property column="secondpic" type="Byte[](2048576)" name="Secondpic" />
    <property column="thirdpic" type="Byte[](2048576)" name="Thirdpic" />
    <property column="forthpic" type="Byte[](2048576)" name="Forthpic" />
    <property column="istraded" type="Boolean" name="Istraded" />

  </class>
</hibernate-mapping>